﻿<!DOCTYPE html>

<html class="x-admin-sm">
<head>
    <meta name="viewport" content="width=device-width" />
    <meta charset="UTF-8">
    <title>生产计划</title>
    <meta name="renderer" content=padding>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />
    <link href="~/js/layui/css/layui.css" rel="stylesheet" />
    <link href="~/X-admin/css/font.css" rel="stylesheet" />
    <script src="~/X-admin/lib/layui/layui.js"></script>
    <link href="~/X-admin/css/xadmin.css" rel="stylesheet" />
    <script src="~/X-admin/js/jquery.min.js"></script>
    <script src="~/X-admin/js/xadmin.js"></script>
</head>
<body>
    <div class="layui-fluid" style="width:100%;">
        <div id="bDiv">
        </div>
        <div style="float:left;width:100%;">
            <div class="layui-card">

                <div class="layui-card-body" style="margin-top:5px">
                    <form class="layui-form layui-col-space5" name="qForm" id="qForm">
                        <div class="layui-inline layui-show-xs-block">
                            <input type="text" name="plCode" placeholder="计划编码" autocomplete="off" class="layui-input" id="plCode">
                        </div>
                        <div class="layui-inline layui-show-xs-block">
                            <input type="text" name="erpOrder" placeholder="销售订单" autocomplete="off" class="layui-input" id="erpOrder">
                        </div>
                        <div class="layui-inline layui-show-xs-block">
                            <input type="text" name="cuName" placeholder="关联客户" autocomplete="off" class="layui-input" id="cuName">
                        </div>
                        <div class="layui-inline layui-show-xs-block">
                            <input type="text" name="proName" placeholder="存货名称" autocomplete="off" class="layui-input" id="proName">
                        </div>

                    </form>
                </div>


                <div class="layui-card-body layui-table-body layui-table-main" id="layui-table-main">
                    <table class="layui-hide" id="list" lay-filter="list"></table>
                </div>
            </div>


        </div>
    </div>
</body>
</html>
<script src="~/js/framework/sysframework.js"></script>
<script src="~/js/framework/commonjs.js"></script>
<script src="~/js/sysweb/planjs.js"></script>
<script type="text/html" id="barDemo">
    <a title="编辑" href="javascript:;" lay-event="view" id="frmView"><i class="layui-icon">&#xe615;</i></a>
    
</script>
<script>
    var webCode = "";

    var selectList = new Array();

    $(function () {
        webCode = getUrlVariable("menuCode");
        BannerData(webCode, "bDiv");
        DictionaryDropDown("pst", "status", "", true);
        loadData();
    })

    var dUrl = "../Summary/getDataList?dataType=pcl&condition=";
    /**
     * 加载数据
     * **/
    function loadData() {

        gjQuery = false;
        layui.use('table', function () {
            var conditon = JSON.stringify(FormToJson("qForm"));
            var table = layui.table;
            table.render({
                elem: '#list'
                , height: 'full-200'   //固定高度-即固定表头固定第一行首行
                , cols: [[ //标题栏
                    { field: 'plCode', align: 'center', title: '计划编码', width: 120, fixed: 'left' }
                    , { field: 'erpOrder', align: 'center', title: '销售订单号', width: 120 }
                    , { field: 'proCode', align: 'center', title: '存货编码', width: 100 }
                    , { field: 'proName', align: 'center', title: '存货名称', width: 170 }
                    , { field: 'number', align: 'center', title: '生产数量', width: 100 }
                    , { field: 'cuName', align: 'center', title: '关联客户', width: 120 }
                    // , { field: 'gyInfo', align: 'center', title: '生产工艺', width: 150 }
                    , { field: 'cpTotal', align: 'center', title: '产成品', width: 120, event: 'cpDetail' }
                    , { field: 'gxTotal', align: 'center', title: '工序半成品', width: 120 ,event: 'bcpDetail' }
                    , { field: 'bfTotal', align: 'center', title: '版费', width: 120, event: 'bfDetail' }
                    , { field: 'gxmTotal', align: 'center', title: '工序用料', width: 120, event: 'pmDetail' }
                    , { field: 'wTotal', align: 'center', title: '废 料', width: 120, event: 'wsDetail' }
                    , { field: 'tranTotal', align: 'center', title: '运 费', width: 120, event: "ysDetail" }
                    , { field: 'total', align: 'center', title: '合 计', width: 120,fixed: 'right' }
                   // , { field: 'right', title: '数据操作', toolbar: '#barDemo', width: 90, fixed: 'right' }
                ]], done: function (res, curr, count) {
                    // $("[data-field='id']").css('display', 'none');//隐藏列
                    currPage = curr;

                }
                , url: dUrl + conditon
                , skin: 'row' //表格风格
                , even: true
                , page: true //是否显示分页
                , limits: [20, 25, 30]
                , limit: 20 //每页默认显示的数量
                , id: "list"
            });
            //监听工具条
            table.on('tool(list)', function (obj) {
                var data = obj.data;
              
                var url = "../Summary/PlanCostDetail?plCode=" + data.plCode + "&dType=" + obj.event;
                if (obj.event == "bfDetail") {
                    url = "../Summary/PlanCostDetail?plCode=" + data.plCode + "&dType=pmDetail&isBg=1";
                }

                InfoOpenPage(url, data.plCode + "-明细", "90%", '85%', false);
              

            });


        });

    }

    var qStr = "";
    /**
     * 获取高级查询字符串
     * **/
    function GetQueryPar(queryStr) {
        qStr = queryStr;
        loadData();
    }





</script>
